The present invention relates to a compression method and compression software for computer files. The present invention also relates to method and software for decompression of computer files that are compressed in accordance with the present invention.
Original information, such as text, image and sound, is usually not compressed when it is stored in the form of computer files. Because the size of such non-compressed files can be large, however, it is often necessary to compress the files, before transmitting them electronically over a wide area network, such as the Internet, or storing them in a portable memory device, such as a floppy disk.
There are currently two existing methods for computer file compression. In the first method, an information type of the file is first recognized by a user who wishes to compress the file, and depending on the type of the file, the user then runs one or more specific types of computer file compression software to compress the file. For example, the user may run commercially available compression software ARJ for compression of text files, LeadView for compression of image files and RealAudio for compression of audio files. Although this method allows to obtain required compression ratio, this process may be time-consuming and may require many different types of compression software. It will be readily appreciated that this method of operation can be particularly inefficient when the file to be compressed contains multiple information types, such as text, image and audio, or when the user wishes to compress a large number of files, particularly if they do not all have the same information type.
The second compression method is to compress a file using only a lossless code, such as LZW, regardless of what type of information is contained in the file. This is manifest in the adoption of the V.42 bis chip in modems to compress all of the information that passes the modem, or in the use of Winzip software to compress files of different types. While this method can save time spent by the user, it has the inherent weakness that this compression mode is not necessarily well suited for the type of information that is being compressed. As a result, the compression ratios provided by such operation method are generally poor. This method of operation is more suitable for compression of character information, but not suitable for other types of information, such as for image or sound.
The object of the present invention is to provide an intelligent compression method for computer file compression. This object is achieved in the present invention, in which different types of information, such as test, image and sound, in a compute file is automatically compressed by a computer, using suitable lossy or lossless codes. The method of the present invention is easy-to-use and provides both an appropriate compression ratio and compression quality.
In one embodiment, the method of the present invention automatically compresses a computer file using a computer and it comprises the following steps: (1) operating to recognize a format of the file by an extension name of the file and in conjunction with control information of the file; and (2) compressing the file in accordance with the format of the file as follows: (a) if the format of the file is not recognized, compressing the file with a lossless code; (b) if the format of the file is recognized and the file includes only a single type of data information, compressing data information of the file with a suitable lossy or lossless code in accordance with the type of data information contained in the file; and (c) if the format of the file is recognized and the file includes a plurality of types of data information, first decompossing the file into a plurality of units each containing only a single type of data information, then compressing each unit with a suitable lossy or lossless code in accordance with the type of data information of the unit.
The method of the present invention may be used in any computer hardware and/or software system, such as in modem software or an e-mail system.
In accordance with another embodiment of the present invention, a method for automatically compressing a computer file using a computer is provided. The method comprises the following steps: (1) operating to recognize a format of the file by an extension name of the file and in conjunction with control information of the file; and (2) compressing the file in accordance with the format of the file as follows: (a) if the format of the file is recognized and the file contains only a single type of data information, compressing the data information contained in the file with a suitable lossy or lossless code in accordance with the type of data information contained in the file; (b) if the file format is not recognized or the file contains more than one type of data information type, compressing the file directly with lossless code.